package com.shigen.demo.pattern.proxy;

/**
 * @author shigenfu
 * @date 2024/3/4 10:32
 */
public class MainMethod {

    public static void main(String[] args) {
        // 生成新对象
        PhoneSmsService phoneSmsService = new PhoneSmsService();
        PcSmsService pcSmsService = new PcSmsService();

        ProxyFactory proxyFactory = new ProxyFactory();
        SmsService PhoneProxyObject = proxyFactory.getProxyObject(phoneSmsService);
        SmsService pcProxyObject = proxyFactory.getProxyObject(pcSmsService);

        PhoneProxyObject.send();
        pcProxyObject.send();
    }

}
